import barcode from "./barcode";

/**
 * Created by 小敏哥 on 2018/1/26.
 */
function convert_length(length) {
    return Math.round(wx.getSystemInfoSync().windowWidth * length / 750);
}

export default function buildBarCode(id, code, width, height) {
    barcode.code128(wx.createCanvasContext(id), code, convert_length(width), convert_length(height))
}